package com.wyg.quartz.controller;

import com.wyg.quartz.service.ScheduleJobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/quartz")
public class QuartzController {
    @Autowired
    private ScheduleJobService scheduleJobService;

    /**
     * 暂停任务
     * @param jobId
     */
    @RequestMapping("/pause/{jobId}")
    public void pause(@PathVariable("jobId") String jobId){
        scheduleJobService.pause(new String[]{jobId});
    }
}
